package leetcode.code0088;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution88 implements IDebug {
	public abstract void merge(int[] nums1, int m, int[] nums2, int n);

	@Override
	public void debug1() {
		// 输入：nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3
		// 输出：[1,2,2,3,5,6]
		String str1 = "[1,2,3,0,0,0]";
		String str2 = "[2,5,6]";
		int m = 3;
		int n = 3;
		String str3 = "[1,2,2,3,5,6]";
		debug(str1, str2, str3, m, n);
	}

	private void debug(String str1, String str2, String str3, int m, int n) {
		int[] num1 = HelpDebug.str2array3(str1);
		int[] num2 = HelpDebug.str2array3(str2);
		int[] e = HelpDebug.str2array3(str3);
		this.merge(num1, m, num2, n);
		HelpDebug.compare(e, num1);

	}

	@Override
	public void debug2() {
		String str1 = "[1]";
		int m = 1;
		int n = 0;
		String str3 = "[1]";
		int[] num1 = HelpDebug.str2array3(str1);
		int[] e = HelpDebug.str2array3(str3);
		this.merge(num1, m, null, n);
		HelpDebug.compare(e, num1);
	}

	@Override
	public void debug3() {
		String str1 = "[2,0]";
		int m = 1;
		String str2 = "[1]";
		int n = 1;
		String str3 = "[1,2]";
		debug(str1, str2, str3, m, n);
	}

	@Override
	public void debug4() {
		String str1 = "[1,2,4,5,6,0]";
		int m = 5;
		String str2 = "[3]";
		int n = 1;
		String str3 = "[1,2,3,4,5,6]";
		debug(str1, str2, str3, m, n);
	}
	public void debug5() {
		String str1 = "[-1,0,0,0,3,0,0,0,0,0,0]";
		int m = 5;
		String str2 = "[-1,-1,0,0,1,2]";
		int n = 6;
		String str3 = "[-1,-1,-1,0,0,0,0,0,1,2,3]";
		debug(str1, str2, str3, m, n);
	}

}
